# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=vulkan
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-headers" "${MINGW_PACKAGE_PREFIX}-${_realname}-man-pages")
_pkgname=Vulkan-Docs
_pkgver=1.0-core+wsi-20160812
pkgver=1.0.24
epoch=1
pkgrel=1
arch=('any')
url="https://www.khronos.org/vulkan/"
makedepends=("asciidoc" "${MINGW_PACKAGE_PREFIX}-libxslt")
license=('custom')
source=("https://github.com/KhronosGroup/${_pkgname}/archive/v${_pkgver}.tar.gz")
sha256sums=('edb08a881740278c85094ba4df0252267b39e89b00b2fcaa5f35fbb9de172458')

build() {
  cd "${_pkgname}-${_pkgver/+/-}/doc/specs/vulkan"
  make manpages
}

package_vulkan-headers() {
  pkgdesc="Vulkan header files"
  cd "${_pkgname}-${_pkgver/+/-}"
  install -dm755 "${pkgdir}${MINGW_PREFIX}"/include/vulkan
  install -m644 src/vulkan/vk_platform.h "${pkgdir}${MINGW_PREFIX}"/include/vulkan/
  install -m644 src/vulkan/vulkan.h "${pkgdir}${MINGW_PREFIX}"/include/vulkan

  install -D -m644 doc/specs/vulkan/copyright.txt "${pkgdir}${MINGW_PREFIX}"/share/licenses/${pkgname}/copyright.txt
}

package_vulkan-man-pages() {
  pkgdesc="Vulkan man pages"
  cd "${_pkgname}-${_pkgver/+/-}"
  install -dm755 "${pkgdir}${MINGW_PREFIX}"/share/man/man3
  install -m644 out/1.0/man/3/*.3 "${pkgdir}${MINGW_PREFIX}"/share/man/man3/

  install -D -m644 doc/specs/vulkan/copyright.txt "${pkgdir}${MINGW_PREFIX}"/share/licenses/${pkgname}/copyright.txt
}

package_mingw-w64-x86_64-vulkan-headers() {
  package_vulkan-headers
}

package_mingw-w64-i686-vulkan-headers() {
package_vulkan-headers
}

package_mingw-w64-x86_64-vulkan-man-pages() {
package_vulkan-man-pages
}

package_mingw-w64-i686-vulkan-man-pages() {
package_vulkan-man-pages
}

